package com.py.credit.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.py.credit.dao.CreditSearchDao;
import com.py.credit.service.CreditSearchService;
import com.py.credit.utils.SQLBuilder;
import com.py.framework.core.common.Page;

@Service
public class CreditSearchServiceImpl implements CreditSearchService {
	
//	private static final List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
//	static {
//		Map<String, Object> map = new HashMap<>();
//		for(int i = 0 ; i < 10 ; i++) {
//			map.put("mainName","张三"+i);
//			map.put("tyshxydm","12345678912345678"+i);
//			map.put("score","90.1"+i);
//			map.put("rank","优秀");
//			
//			list.add(map);
//		}
//	}

	@Autowired
	private CreditSearchDao creditSearchDao;
	
	@Override
	public Map<String, Object> getModelByOffice(String ywId, Long deptId, String ztType) {
		return creditSearchDao.getModelByOffice(ywId, deptId, ztType);
	}

	@Override
	public List<Map<String, Object>> getByConditionForPage(String modelId,Double showScore, List<String> columns,
			String[] additionalColumns, String conditionStr, Page page) {
		List<String> conditions = SQLBuilder.createConditionSql(conditionStr);
		List<Map<String, Object>> batchLogs = creditSearchDao.selectByConditionForPage(modelId, showScore , columns, additionalColumns,
				conditions, page);
//		return list;
		return batchLogs;
	}

	@Override
	public List<Map<String, Object>> get2ByConditionForPage(Double showScore ,List<String> columns,
			String[] additionalColumns, String conditionStr, Page page) {
		List<String> conditions = SQLBuilder.createConditionSql(conditionStr);
		List<Map<String, Object>> batchLogs = creditSearchDao.select2ByConditionForPage(showScore , columns, additionalColumns,
				conditions, page);

		return batchLogs;
	}
	
	public List<String> getBumeng(String ywId , String mainType) {
		return creditSearchDao.getBumeng(ywId , mainType);
	}


	

	


}
